<template>
	<view class="content">
		<view class="flppdp">
			<view :class="[(active1 == index)?'active1':'']" class="fs18 C999" @click="tab(index);toUrl(item.toUrl)" v-for="(item,index) in flppdpLis" :key="index">{{item.name}}</view>
		</view>	
		<view v-for="(item,index) in lisData" :key="index" class="commonBox">
			<view class="fs18 C333 lh45">
				换货编号：{{item.order_sn}}
			</view>
			<view class="fs18 C999 lh35">
				换货订单编号：{{item.refund_sn}}
			</view>
			<view class="fs18 C999 lh35">
				申请时间：{{item.add_time | formaDate('yyyy-mm-dd-hh-mm-ss')}}
			</view>
			<view class="fs18 C999 lh35">
				换货商品信息：
			</view>
			<view style="padding-top: 12upx;" class="flexsb">
				<view style="width: 220upx;" class="">
					<image style="width: 200upx;height: 200upx;" :src="item.goods_image" mode=""></image>
				</view>
				<view style="width: 500upx;" class="commonBoxPR">
					<view style="min-height: 80upx;" class="fs20 C333 twoline lh40">
						{{item.goods_name}}
					</view>
					<view class="fs18 Cf71c6e lh80">
						换货原因：{{item.buyer_message}}
					</view>					
				</view>
			</view>
			<view class="fs18 C333 lh60">
				<!-- 退款金额：{{item.refund_amount}} &nbsp;&nbsp;&nbsp;&nbsp;  -->
				 换货数量：{{item.goods_num}}
			</view>
			<view @click="toDetail(item.refund_id)" class="commonBoxBtn tac fs18 Cfff bold">
				查看详情
			</view>
			<view class="escQu" v-if="item.seller_state==1&&item.refund_state==1" @click="escaprtye(item)">
				取消
			</view>
		</view>
		
		<view class="None" v-if="!lisData.length">
			<image style="width: 100%;" :src="`${picUrl}/InfoNull.png`" mode="widthFix"></image>
		</view>
	<!-- 	<view class="commonBox">
			<view class="fs18 C333 lh45">
				1退款退货编号：1434354443133643
			</view>
			<view class="fs18 C999 lh35">
				店铺名称：aiteshop
			</view>
			<view class="fs18 C999 lh35">
				退款订单编号：1422414341413254
			</view>
			<view class="fs18 C999 lh35">
				申请时间：2019-06-15 16:40
			</view>
			<view class="fs18 C999 lh35">
				退货商品信息：
			</view>
			<view class="flexsb">
				<view style="width: 220upx;" class="">
					<image style="width: 200upx;height: 200upx;" src="../../static/images/refund_tuihuoLi1.jpg" mode=""></image>
				</view>
				<view style="width: 500upx;" class="commonBoxPR">
					<view style="min-height: 80upx;" class="fs20 C333 twoline lh40">
						女装春季时尚休闲气质春秋三件套运动服套装潮 啡色 S 纯棉
					</view>
					<view class="fs18 Cf71c6e lh40">
						退款原因：取消订单，全部退款
					</view>	
					<view class="fs18 Cf71c6e lh40">
						退款兑换码：34634684356
					</view>					
				</view>
			</view>
			<view class="fs18 C333 lh60">
				退款金额：189.00元   退货数量：1
			</view>
			<view class="commonBoxBtn tac fs18 Cfff bold">
				查看详情
			</view>
		</view> -->

		
	</view>
	
	
</template>

<script>
	export default {
		data(){
			return{
				lisData:[],
				allData:[],
				notsettleData:[],
				settleData:[],
				active1:2,
				flppdpLis:[
					{"name":"退款申请","toUrl":"tuikuan"},
					{"name":"退货申请","toUrl":"tuihuo"},
					{"name":"换货申请","toUrl":"xuniDM"}
				],
				sortPage:0,
				active2flag:0,
				express_list:"",
			}
		},
		onLoad() {
			this.getLis()
		},
		onShow() {
			
		},
		methods:{	
			escaprtye(e) {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '是否取消申请',
					success: function(res) {
						if (res.confirm) {
							that.$util.request({
								url: '/mobile/index.php?act=member_refund&op=cancel_refund',
								method: 'post',
								data: {
									refund_id: e.refund_id
								},
							}).then(function(res) {
								console.log(res)
								if (res.error_code == 0) {
									uni.showToast({
										title: '取消成功',
										icon: 'none'
									})
									that.getLis()
								}
							})
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
			},
			getLis(){
				var that=this;
				this.$util.request({
					url: '/mobile/index.php?act=member_exchange&op=index',
					method: 'post',
					data: {},
				}).then(function(res) {
					console.log(res)
					that.express_list=res.datas.express_list;
					that.lisData=res.datas.return_list									
				})
			},
			toDetail(id){
				uni.navigateTo({
					url:"xuniDMDetail?refundId="+id+"&express_list="+JSON.stringify(this.express_list)
				})
			},
			toUrl(xx){
				uni.redirectTo({
					url:xx
				})
			},
			tab(index){
				this.active1=index
			},
			tab2(index,url){
				this.active2flag=index
				console.log(this.active2flag);
				uni.switchTab({
					url:url
				})
			}
		}
	}
</script>

<style>
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	view{
		box-sizing: content-box;		
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}
	.None{
		height: 92%;
		background-color: #fff;
	}
	.titleNview-placing {
		height: var(--status-bar-height);
		box-sizing: content-box;
	 }
	.lh20{
		line-height: 20upx;
		height: 20upx;
	}
	.lh25{
		line-height: 25upx;
	}
	.lh30{
		line-height: 30upx;
	}
	.lh35{
		line-height: 35upx;
	}
	.lh40{
		line-height: 40upx;
	}
	.lh45{
		line-height: 45upx;
	}
	.lh50{
		line-height: 50upx;
	}
	.lh60{
		line-height: 60upx;
	}
	.lh70{
		line-height: 70upx;
	}
	.lh80{
		line-height: 80upx;
	}
	.C000{
		color: #000000;
	}
	.Ce13d97{
		color: #ff4300;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.Cc06{
		color: #ff4300;
	}
	.mt55mb30{
		margin-top: 55upx;
		margin-bottom: 30upx;
	}
	.Cfff{
		color: #FFFFFF;
	}
	
	.flex{		
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-content: space-between;
	}
	.paddingL20{
		padding-left: 20upx;
	}
	.C999{
		color:#999 ;
	}
	.Cff0101{
		color:#ff0101 ;
	}
	.Cc00251{
		color: #c00251;
	}
	.strick{
		text-decoration: line-through;
	}
	.Cfe0000{
		color: #ff4300;
	}
	.line1{
		width: 430upx;
	}
	.hide{
		display: none;
	}
	.marginB20{
		margin-bottom: 20upx;
	}
	.oneLine{
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.twoline{
	   overflow : hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	.pl20{
		padding-left: 20upx;
	}
	.positionT{
		position: relative;
		top: 50upx;
	}
	.paddingB15{
		padding-bottom: 15upx;
	}
	.borderB{
		border-bottom: 1px solid #f4f4f6;
	}
	.borderT{
		border-top: 1px solid #f4f4f6;
	}
	.gl{
		position: absolute;
		right: 30upx;
	}
	.pr30{
		padding-right: 30upx;
	}
	.C333{
		color: #333333;
	}
	.C666{
		color: #666666;
	}
	.Cf00{
		color: #ff0000;
	}
	
	.bold{
		font-weight: bold;
	}
	.C1d1d1d{
		color:#1d1d1d ;
	}
	.fl{
		float: left;
	}
	.fr{
		float: right;
	}
	.tac{
		text-align: center;
	}
	.Ce5258e{
		color: #e5258e;
	}
	.Cccc{
		color: #CCCCCC;
	}
	.Cf7881c{
		color: #f7881c;
	}
	uni-page-body {
		background-color: #FFFFFF;
		color: rgb(102, 102, 102);
	}		
	.fs30{
		/* font-size: 30upx */
		font-size: 45upx
	}
	.fs26{
		font-size:39upx
		/* font-size: 26upx */
	}
	.fs12{
		font-size: 18upx
		/* font-size: 12upx */
	}
	.fs16{
		font-size: 24upx
		/* font-size: 16upx */
	}
	.fs14{
		font-size: 21upx
		/* font-size: 14upx */
	}
	.fs15{
		font-size: 22.5upx
		/* font-size: 15upx */
	}
	.fs27{
		font-size: 40.5upx
		/* font-size: 27upx */
	}
	.fs18{
		font-size: 27upx
		/* font-size: 18upx */
	}
	.fs28{
		font-size: 42upx
		/* font-size: 28upx */
	}
	.fs10{
		font-size: 15upx
		/* font-size: 10upx */
	}
	.fs30{
		font-size: 45upx
		/* font-size: 28upx */
	}
	.fs36{
		font-size: 54upx
		/* font-size: 28upx */
	}
	
	.fs24{
		font-size: 36upx
		/* font-size: 24upx */
	}
	.fs20{
		font-size:30upx
		/* font-size: 20upx */
	}
	.fs22{
		font-size:33upx
		/* font-size: 22upx */
	}
	.fs21{
		font-size: 31.5upx
		/* font-size: 21upx */
	}	
	.flexsb{
		display: flex;
		justify-content: space-between;
	}
	.plr20{
		padding: 0 20upx;
	}
	.plr10{
		padding: 0 10upx;
	}
	.f6f4f5{
		background-color: #fff;
	}	
	.Cf74d0f{
		color: #f74d0f;
	}
	.Cf71c6e{
		color: #ff4300;
	}
	.C2dc34d{
		color: #2dc34d;
	}
	.mt20{
		margin-top: 20upx;
	}
	.ti2{
		text-indent: 2em;
	}
	
	
	.content{
		height: 100%;
		background-color: #f6f4f5;
		/* margin-bottom: 200upx; */
	}
	.commonBox:last-child{
		margin-bottom: 0;
	}
	.bottom{
		box-sizing: border-box;
		padding: 0 10upx;
		background-color: #FFFFFF;
		position: fixed;
		z-index: 99999999999;
		left: 0;
		bottom: 0;
		height: 98upx;
		width: 100%;
		box-shadow: 0upx -1upx 10upx rgba(0,0,0,0.8);
		display: flex;
		flex-direction: row;
		justify-content: space-around;
	}
	.bottom view{
		font-size: 27upx;
		color: #666;
		text-align: center;
	}
	.bottom view.active2{
		color: #ff4300;
	}
	.bottom image{
		position: relative;
		top: 15upx;
		width: 33upx;
		height: 33upx;
	}
	.flppdp{
		display: flex;
		justify-content: space-around;
	}
	.flppdp view{
		width: 33%;	
		text-align: center;
		height: 123upx;
		line-height: 123upx;
	}
	.flppdp view.active1{
		border-bottom: 1upx solid #ff4300;
		color:#ff4300;
	}
	.commonBox{
		margin-bottom: 30upx;
		box-sizing: border-box;
		width: 100%;
		/* height: 600upx; */
		background-color: #fff;
		padding: 37upx 33upx;
		position: relative;
	}
	.escQu{
		position: absolute;
		right: 30rpx;
		top: 30rpx;
	}
	.commonBoxPR{
		box-sizing: border-box;
		padding-top: 30upx;
	}
	.commonBoxBtn{
		line-height: 70upx;
		height: 70upx;
		width: 100%;
		background-color: #ff4300;
	}

</style>

